package com.example.imtoken.modules.main.my.address.create

import android.view.View
import androidx.navigation.fragment.findNavController
import com.blankj.utilcode.util.KeyboardUtils
import com.blankj.utilcode.util.ToastUtils
import com.example.imtoken.R
import com.example.imtoken.core.base.BaseFragment
import com.example.imtoken.databinding.CreateAddressFragmentBinding

class CreateAddressFragment :
    BaseFragment<CreateAddressViewModel, CreateAddressFragmentBinding>(CreateAddressViewModel::class.java) {

    override fun initLayoutId(): Int {
        return R.layout.create_address_fragment
    }

    override fun init() {
        initView()
    }

    private fun initView() {
        dataBinding.headView.tvHeadTitles.text = getString(R.string.createAddress)
        dataBinding.headView.vLine.visibility = View.INVISIBLE
        dataBinding.headView.ivHeadBack.setOnClickListener { findNavController().navigateUp() }
        dataBinding.headView.tvHeadFunction.setOnClickListener {
            ToastUtils.showShort("保存")
        }
        dataBinding.headView.tvHeadFunction.visibility = View.VISIBLE
        dataBinding.headView.tvHeadFunction.text = getString(R.string.preservation)

        KeyboardUtils.showSoftInput(dataBinding.etAddress)
    }

}